/*
 * @Author: your name
 * @Date: 2019-11-21 11:27:25
 * @LastEditTime: 2019-11-22 14:27:35
 * @LastEditors: your name
 * @Description: In User Settings Edit
 * @FilePath: \testd:\rich-tao\实验室\laboratory\web\avue-cli\src\main.js
 */
import Vue from 'vue';
import axios from './router/axios';
import VueAxios from 'vue-axios';
import App from './App';
import router from './router/router';
import './permission'; // 权限
import './error'; // 日志
import store from './store';
import {
  loadStyle
} from './util/util'
import * as urls from '@/config/env';
import {
  iconfontUrl,
  iconfontVersion
} from '@/config/env';
import * as filters from './filters' // 全局filter
import './styles/common.scss';
// 引入avue的包
import Avue from '@smallwei/avue';
import '@smallwei/avue/lib/index.css'

import basicContainer from './components/basic-container/main'
import VueClipboard from 'vue-clipboard2'
// 插件 json 展示
import vueJsonTreeView from 'vue-json-tree-view'
import infiniteScroll from 'vue-infinite-scroll'
//element-ui
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css'
import Print from 'vue-print-nb'
import moment from 'moment'
import echarts from 'echarts'
import animated from "animate.css"
import VideoPlayer from 'vue-video-player'
require('video.js/dist/video-js.css')
require('vue-video-player/src/custom-theme.css')
// import SWF_URL from 'videojs-swf/dist/video-js.swf'
Vue.use(VideoPlayer)
//引入 hls
import "videojs-contrib-hls"
import 'videojs-flash'   //开启H5
import VueBarcode from '@xkeshi/vue-barcode';
Vue.component('barcode', VueBarcode);

Vue.prototype.$echarts = echarts
Vue.prototype.$moment = moment;


Vue.use(Avue)

Vue.use(router)

Vue.use(VueClipboard)

Vue.use(vueJsonTreeView)

Vue.use(VueAxios, axios)

Vue.use(Print);

Vue.use(ElementUI);
Vue.use(infiniteScroll)
// 注册动画
Vue.use(animated)
//注册全局容器
Vue.component('basicContainer', basicContainer)
// 加载相关url地址
Object.keys(urls).forEach(key => {
  Vue.prototype[key] = urls[key];
})

// 加载过滤器
Object.keys(filters).forEach(key => {
  Vue.filter(key, filters[key])
})
// 动态加载阿里云字体库
iconfontVersion.forEach(ele => {
  loadStyle(iconfontUrl.replace('$key', ele));
})
Vue.config.productionTip = false;

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')